package design.demos.order;

import design.demos.order.bo.Order;
import design.demos.order.enums.StateEnum;

public class Demo {
    public static void main(String[] args) {
        StateHandler stateHandler = new StateHandler();
        Order order = stateHandler.stateHandler(new Order(), StateEnum.ORDER_PENDING);
        order = stateHandler.stateHandler(order, StateEnum.ORDER_PROCESSING);
        order = stateHandler.stateHandler(order, StateEnum.ORDER_END);
        System.out.println("最终状态变更为" + order.getState());
    }
}
